<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script type="text/javascript">
    class Teacher{
        constructor(name,sex,age) {
            this.name = name;
            this.sex = sex;
            this.age = age;
        }
        toString(){
            //把对象转换为json格式的字符串{"name":"值"}
            return JSON.stringify(this);
        }
        show(){
            console.log(this.name);
        }
    }
    //定义所有对象都可以使用的属性
    Teacher.prototype.tel="";
    //只属于类,静态属性
    Teacher.email = "";
    //3.通过要给对象给所有对象添加属性
    tea._proto__.status=1;
    let msg=tea.tostring();
    let tea = new Teacher("zhangsan","women","18");
    //当前对象可以使用的属性
    tea.address = "qingdao";
</script>
</html>